package cn.zxl.spring.holiday.job.web.controller;

import cn.zxl.spring.holiday.job.domain.OperateLog;
import cn.zxl.spring.holiday.job.qo.son.LogQueryObject;
import cn.zxl.spring.holiday.job.service.OperateLogService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Date 2021/10/7 15:10
 * @Version 1.0
 * @Description
 */
@Controller
@RequestMapping("/log")
public class LogController {

    @Autowired
    private OperateLogService operateLogService;

    @RequestMapping("/list")
    public String list(@ModelAttribute("log") LogQueryObject logQueryObject, Model model) {
        PageInfo<OperateLog> query = operateLogService.query(logQueryObject);
        System.out.println(logQueryObject);
        model.addAttribute("pageInfo",query);
        return "log/list";
    }
}
